Semantics is the literal
meaning of words and phrases, while pragmatics identifies
the meaning of words and phrases based on how language
is used to communicate. Natural Language Processing uses context, things like neighboring words, the clinical domain, or
the section of a clinical note to identify the correct
meaning of a word or phrase. Let's start with semantics. Semantics can be used to help choose or disambiguate between two parts
of speech for a single word. For example, the word "discharge"
can be both a noun and a verb. You can create a manual rule that says combining discharge with the location, like discharged from hospital, is the verb form of discharge, while combining discharge
with an anatomic location, like discharge from eye, is the noun form. Many of these rules
are actually developed through machine learning on a corpus of notes that develops a classifier
for each ambiguous word. Semantics can also be used to identify the meaning of
the whole phrase structure. In this case, instead of
tagging the parts of speech, you are classifying the category
and meaning of the words. Let's look at the phrase
"no increase in pain". "Pain" is a symptom, "increase in" is a change, and the word "no" is a negation. Combining these, the negation
is nested within the change. So, it is clear that there
is no change in the symptom. The concept of negation is absolutely
critical in clinical text, as it is common to rule
out certain disorders or report what symptoms a patient
is not experiencing. It is important when
working with clinical text to pay attention to and
check for negation. In addition to these semantic meanings, there are also
pragmatic contexts that can affect the interpretation of
the meaning of the phrase. For example, the location of texts
within a note may affect its meaning. The medication Penicillin, found in
the medication section of a note, means something very different than finding Penicillin in
the allergy section. There are also aspects
of how we communicate, discourse, that affect the
meaning of words and phrases. This is especially true
for abbreviations. For example, the abbreviation SSRI is typically used to mean Selective
Serotonin Re-uptake Inhibitors, a type of antidepressant. But, if a sentence or text is talking about a diabetic patient's
glucose control, it's actually probably referring
to Sliding Scale Regular Insulin. We also have the bad habit
in writing of not always making clear what
our pronouns are referring to. For example, in the sentence's "mass
noted in the upper lobe", it was well marginated. From a syntax perspective, it is not clear what the
pronoun "it" is referring to. Based on location, it should be
referring to the upper lobe. Except, based on our expert knowledge, we know that well marginated
is referring to the outcome of a surgical technique to remove
tumors or masses from tissue. Finally, there are
simply situations where the creators of the text have
knowledge that is not written down. For example, the phrase "he couldn't have seen Dr. Jones last week" doesn't make semantic sense without
the world knowledge that Dr. Jones was traveling
out of town last week, and thus, literally, the patient
could not have seen Dr. Jones. These examples may seem
obvious to us as humans, but trying to train computers
to understand and apply the same forms of logic is
an extremely complex task. This is part of the reason why
developing NLP tools is so difficult.